﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ISSGroup5ModelPresenter;
using ISSGroup5ModelPresenter.View;
using ISSGroup5ModelPresenter.Presenter;

namespace View
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window, ILoginView 
    {
        LoginPresenter presenter = null;
        public MainWindow()
        {
            InitializeComponent();
            presenter = new LoginPresenter(this);
        }

        private void loginBtn_Click(object sender, RoutedEventArgs e)
        {
            string username = txtboxUsername.Text;
            string password = txtboxPassword.Password;
;
            presenter.Login(username, password);
        }

        private void exitBtn_Click(object sender, RoutedEventArgs e)
        {
            presenter.Exit();
        }

        public void LoginFail()
        {
            MessageBox.Show("Invalid username or password!!!!");
        }

        public void LoadView(object arg)
        {
            
        }

        public void ExitView()
        {
            this.Close();
        }

        public void ViewMessage(string message)
        {
            MessageBox.Show(message);
        }
    }
}
